package com.bruce.pattern.structural.decorator.v3;


/**
 * Created by bruce on 2018/11/3 23:09
 */
public abstract class AbsDecorator extends AbsBattercake {

    private AbsBattercake battercake;

    public AbsDecorator(AbsBattercake absBattercake) {
        this.battercake = absBattercake;
    }

    public abstract String descDecorator();

    public abstract int costDecorator();

    @Override
    public String getDesc() {
        return battercake.getDesc() + " " + descDecorator();
    }

    @Override
    public int cost() {
        return battercake.cost() + costDecorator();
    }
}
